const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: {
    resolve: {
      //取目录别名
      alias: {
        //@代表目录src
        'assets': '@/assets',
        'components': '@/components',
        'api': '@/api',
        'utils': '@/utils',
        'views': '@/views'
      }
    }
  },
  devServer: {
    port: 8888,
    proxy: {
      '/api': {
        target: 'http://localhost:8080', //请求的接口
        changeOrigin: true,//允许跨域
        pathRewrite: {
          '^/api': '/'
        }
      }
    }
  }

})
